package com.cn.api;


import com.cn.dto.StockDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Primary
@FeignClient(value = "stock-client",path = "/api/stock")
public interface StockService {

    @GetMapping("/findAll")
    List<StockDTO> findAll(@RequestBody StockDTO stockDTO);

    @PostMapping(value = "/add")
    int add(@RequestBody StockDTO stockDTO);

    @DeleteMapping(value = "/delete")
    int delete(@RequestBody StockDTO stockDTO);

    @PostMapping(value = "/update")
    int update(@RequestBody StockDTO stockDTO);


    @PostMapping(value = "/findByProductId")
    StockDTO findByProductId(@RequestParam int productId);

}
